package com.java46.service;

import com.java46.entity.Candidate;
import com.java46.entity.Positi;
import com.java46.mapper.CandidateMapper;
import com.java46.mapper.PositiMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @ClassName RecruitmentService
 * @Description 招聘的service方法层
 * @Author Tigger Wu
 * @Date 2018/8/1614:06
 * @Version 1.0
 **/
@Service
@Transactional
public class RecruitmentService {
    @Autowired
    private PositiMapper positiMapper;
    /*
     * 查询目前所有暂缺的职位信息
     *
     * @author Tigger Wu
     * @date 2018/8/16 14:10
     * @param
     * @return
     */

    public List<Positi> querylist(){
        List<Positi>clist = positiMapper.selectAll();
        return  clist;
    }
/*
 * 添加求职人员
 *
 * @author Tigger Wu
 * @date 2018/8/16 17:01
 * @param
 * @return
 */
    @Autowired
    private CandidateMapper candidateMapper;
    public void addRec(Candidate candidate){
        if(candidate == null){
            throw  new RuntimeException("a error has occourd,it  makes me fell sad");
        }
        candidateMapper.insert(candidate);
    }
}
